package com.wy.Task;

import com.wy.Run;

public class ReadTask implements Runnable {
    public void run() {
        System.out.println("我是读线程 ");
        while (Run.flag) {
            try {
                Thread.sleep(1000);
                System.out.println(Thread.currentThread().getName() + "  线程在运行");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        System.out.println(Thread.currentThread().getName() + " 线程运行结束");
        try {
            System.out.println(Thread.currentThread().getName()+ "在等一会");
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(Thread.currentThread().getName() + "彻底结束");
    }
}
